﻿@using Yyyg.WebUI.Models
@{
    ViewBag.Title = "Myyg";
    Layout = "~/Views/UserInfo/_LayoutUserPanel.cshtml";
    var Announce = Model.AllYgs.Where(s => s.Status == 1);
    var NotAnnounce = Model.AllYgs.Where(s => s.Status == 0);
    bool tonewjx = ViewBag.ToNewJx;
    int[] donLook = ViewBag.NewLott;
    bool hasdon = donLook.Length > 0;
}
@model MyygVM
@section head{
    <link href="~/Content/userpanel-myyg.css?@Tools.GetRandMax()" rel="stylesheet" />
    <script src="~/Scripts/src/userpanel-myyg.js?version=2105301354"></script>
}
<div class="myygbx">
    <div class="titbar iconfont icon-shoppingcart">我的云购</div>
    <div class="tabelbx">
        <div style="margin-top:20px;" class="titbar titbar-sub">夺宝信息</div>
        <div class="layui-tab">
            <ul class="layui-tab-title">
                <li class="@(tonewjx?"":"layui-this")" >进行中</li>
                <li class="@(tonewjx?(hasdon?"has layui-this":"layui-this"):(hasdon?"has":""))">已开奖</li>
                <li>所有记录</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item @(tonewjx?"":"layui-show")">
                    <table style="display:none;" lay-filter="dtb-all" id="datatable-notAnnounce" class="layui-table" lay-skin="line">
                        <thead>
                            <tr>
                                <th lay-data="{align:'center',field:'rhid',hide:true}">rhid</th>
                                <th lay-data="{align:'center',field:'img',width:130}">图片</th>
                                <th lay-data="{align:'center',field:'title',width:240}">商品名称</th>
                                <th lay-data="{align:'center',field:'per'}">期号</th>
                                <th lay-data="{align:'center',field:'join',sort:true}">参与人次</th>
                                <th lay-data="{align:'center',field:'rem',sort:true}">剩余人次</th>
                                <th lay-data="{align:'center',field:'status',templet:'#robstatus'}">夺宝状态</th>
                                <th lay-data="{align:'center',toolbar:'#rowbar',width:170}">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var itm in NotAnnounce)
                            {
                                <tr>
                                    <td>@itm.RushID</td>
                                    <td><a class="gdlink" href="/home/goodabout?rhid=@itm.RushID"><img src="@itm.ImgSrc" /></a></td>
                                    <td>@itm.Title</td>
                                    <td>第@(itm.Pernum)期</td>
                                    <td>@itm.Join</td>
                                    <td>@itm.Rem</td>
                                    <td>@itm.Status</td>
                                    <td></td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
                <div class="layui-tab-item @(!tonewjx?"":"layui-show")">
                    <table lay-filter="dtb-all" id="datatable-announce" class="layui-table" lay-skin="line">
                        <thead>
                            <tr>
                                <th lay-data="{align:'center',field:'rhid',hide:true}"></th>
                                <th lay-data="{align:'center',field:'img',width:130}">图片</th>
                                <th lay-data="{align:'center',field:'title',width:240}">商品名称</th>
                                <th lay-data="{align:'center',field:'per'}">期号</th>
                                <th lay-data="{align:'center',field:'join',sort:true}">参与人次</th>
                                <th lay-data="{align:'center',field:'rem',sort:true}">剩余人次</th>
                                <th lay-data="{align:'center',field:'status',templet:'#robstatus'}">夺宝状态</th>
                                <th lay-data="{align:'center',toolbar:'#rowbar',width:170}">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var itm in Announce)
                            {
                                <tr>
                                    <td>@itm.RushID</td>
                                    <td><a class="gdlink @(donLook.Contains(itm.RushID)?"new":"")" href="/home/goodabout?rhid=@itm.RushID"><img src="@itm.ImgSrc" /></a></td>
                                    <td>@itm.Title</td>
                                    <td>第@(itm.Pernum)期</td>
                                    <td>@itm.Join</td>
                                    <td>@itm.Rem</td>
                                    <td>1</td>
                                    <td></td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
                <div class="layui-tab-item">
                    <table lay-filter="dtb-all" id="datatable-all" class="layui-table" lay-skin="line">
                        <thead>
                            <tr>
                                <th lay-data="{align:'center',field:'rhid',hide:true}">rhid</th>
                                <th lay-data="{align:'center',field:'img',width:130}">图片</th>
                                <th lay-data="{align:'center',field:'title',width:240}">商品名称</th>
                                <th lay-data="{align:'center',field:'per'}">期号</th>
                                <th lay-data="{align:'center',field:'join',sort:true}">参与人次</th>
                                <th lay-data="{align:'center',field:'rem',sort:true}">剩余人次</th>
                                <th lay-data="{align:'center',field:'status',sort:true,templet:'#robstatus'}">夺宝状态</th>
                                <th lay-data="{align:'center',toolbar:'#rowbar',width:180}">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var itm in Model.AllYgs)
                            {
                                <tr>
                                    <td>@itm.RushID</td>
                                    <td><a class="gdlink" href="/home/goodabout?rhid=@itm.RushID"><img src="@itm.ImgSrc" /></a></td>
                                    <td>@itm.Title</td>
                                    <td>第@(itm.Pernum)期</td>
                                    <td>@itm.Join</td>
                                    <td>@itm.Rem</td>
                                    <td>@itm.Status</td>
                                    <td></td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script id="rowbar" type="text/html">
    <a lay-event="robdet" class="layui-btn layui-btn-normal layui-btn-xs" href="/home/goodabout?rhid={{d.rhid}}">{{ d.status==0?'商品详情':'开奖详情'}}</a>
    <button lay-event="lokrobs" class="layui-btn layui-btn-warm layui-btn-xs">夺宝详情</button>
</script>
<script id="robstatus" type="text/html">
    {{# if(d.status=='0'){ }}
    <span class="robstatus-ongoing">正在夺宝中...</span>
    {{# }else{ }}
    <span class="robstatus-end">已开奖</span>
    {{# } }}
</script>